/*
*Copyright 2021-2023 NERCIS
*
*Licensed under the Apache License, Version 2.0 (the "License");
*you may not use this file except in compliance with the License.
*You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*Unless required by applicable law or agreed to in writing, software
*distributed under the License is distributed on an "AS IS" BASIS,
*WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*See the License for the specific language governing permissions and
*limitations under the License.
*/

package cn.ac.nercis.pes.community.model.vo.evaluation;

import javafx.beans.property.SimpleDoubleProperty;
import javafx.beans.property.SimpleStringProperty;
import org.apache.commons.lang3.StringUtils;

/**
 * 结果修正信息修改视图模型
 * @author zpy
 * @version 1.0.0
 */
public class ResultCorrectionVO {
    private final SimpleStringProperty id = new SimpleStringProperty();
    private final SimpleStringProperty systemId = new SimpleStringProperty();
    private final SimpleStringProperty layerTargetId = new SimpleStringProperty();
    private final SimpleStringProperty unitTargetId = new SimpleStringProperty();
    private final SimpleStringProperty unitTargetName = new SimpleStringProperty();
    private final SimpleStringProperty recordId = new SimpleStringProperty();
    private final SimpleStringProperty assetId = new SimpleStringProperty();
    private final SimpleStringProperty assetName = new SimpleStringProperty();
    private final SimpleStringProperty beforeResult = new SimpleStringProperty();
    private final SimpleStringProperty result = new SimpleStringProperty();
    private final SimpleStringProperty score = new SimpleStringProperty();
    private final SimpleStringProperty desc = new SimpleStringProperty();
    private final SimpleStringProperty offsetRecordId = new SimpleStringProperty();
    private final SimpleStringProperty offsetAssetName = new SimpleStringProperty();
    private final SimpleDoubleProperty offsetScore = new SimpleDoubleProperty();
    private boolean change = false;

    public boolean isChange(){
        return change;
    }

    public void resetChange(){
        change = false;
    }


    public String getId() {
        return id.get();
    }

    public SimpleStringProperty idProperty() {
        return id;
    }

    public void setId(String id) {
        this.id.set(id);
    }

    public String getSystemId() {
        return systemId.get();
    }

    public SimpleStringProperty systemIdProperty() {
        return systemId;
    }

    public void setSystemId(String systemId) {
        this.systemId.set(systemId);
    }

    public String getLayerTargetId() {
        return layerTargetId.get();
    }

    public SimpleStringProperty layerTargetIdProperty() {
        return layerTargetId;
    }

    public void setLayerTargetId(String layerTargetId) {
        this.layerTargetId.set(layerTargetId);
    }

    public String getUnitTargetId() {
        return unitTargetId.get();
    }

    public SimpleStringProperty unitTargetIdProperty() {
        return unitTargetId;
    }

    public void setUnitTargetId(String unitTargetId) {
        this.unitTargetId.set(unitTargetId);
    }

    public String getUnitTargetName() {
        return unitTargetName.get();
    }

    public SimpleStringProperty unitTargetNameProperty() {
        return unitTargetName;
    }

    public void setUnitTargetName(String unitTargetName) {
        this.unitTargetName.set(unitTargetName);
    }

    public String getRecordId() {
        return recordId.get();
    }

    public SimpleStringProperty recordIdProperty() {
        return recordId;
    }

    public void setRecordId(String recordId) {
        this.recordId.set(recordId);
    }

    public String getAssetId() {
        return assetId.get();
    }

    public SimpleStringProperty assetIdProperty() {
        return assetId;
    }

    public void setAssetId(String assetId) {
        this.assetId.set(assetId);
    }

    public String getAssetName() {
        return assetName.get();
    }

    public SimpleStringProperty assetNameProperty() {
        return assetName;
    }

    public void setAssetName(String assetName) {
        this.assetName.set(assetName);
    }

    public String getBeforeResult() {
        return beforeResult.get();
    }

    public SimpleStringProperty beforeResultProperty() {
        return beforeResult;
    }

    public void setBeforeResult(String beforeResult) {
        this.beforeResult.set(beforeResult);
    }

    public String getResult() {
        return result.get();
    }

    public SimpleStringProperty resultProperty() {
        return result;
    }

    public void setResult(String result) {
        if(!StringUtils.equals(getResult(),result)){
            change = true;
        }
        this.result.set(result);
    }

    public String getScore() {
        return score.get();
    }

    public SimpleStringProperty scoreProperty() {
        return score;
    }

    public void setScore(String score) {
        if(!StringUtils.equals(getScore(),score)){
            change = true;
        }
        this.score.set(score);
    }

    public String getDesc() {
        return desc.get();
    }

    public SimpleStringProperty descProperty() {
        return desc;
    }

    public void setDesc(String desc) {
        if(!StringUtils.equals(getDesc(),desc)){
            change = true;
        }
        this.desc.set(desc);
    }

    public String getOffsetRecordId() {
        return offsetRecordId.get();
    }

    public SimpleStringProperty offsetRecordIdProperty() {
        return offsetRecordId;
    }

    public void setOffsetRecordId(String offsetRecordId) {
        if(!StringUtils.equals(getOffsetRecordId(),offsetRecordId)){
            change = true;
        }
        this.offsetRecordId.set(offsetRecordId);
    }

    public String getOffsetAssetName() {
        return offsetAssetName.get();
    }

    public SimpleStringProperty offsetAssetNameProperty() {
        return offsetAssetName;
    }

    public void setOffsetAssetName(String offsetAssetName) {
        if(!StringUtils.equals(getOffsetAssetName(),offsetAssetName)){
            change = true;
        }
        this.offsetAssetName.set(offsetAssetName);
    }

    public double getOffsetScore() {
        return offsetScore.get();
    }

    public SimpleDoubleProperty offsetScoreProperty() {
        return offsetScore;
    }

    public void setOffsetScore(double offsetScore) {
        if(getOffsetScore() != offsetScore){
            change = true;
        }
        this.offsetScore.set(offsetScore);
    }
}